<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/tips.js"></script>
<script src="${staticServer}/js/web/consultant_client_tracking_list.js?1.0"></script>

<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<script>
var contextPath='${contextPath}';

$(function(){
	$("#center").val("<#if zhichu??>${zhichu.regionns}</#if>")
});

var delMoney = function(){
	var $obj = $("#datas td input[type=checkbox]:checked");
	if($obj.length == 0){
		infopad.err("请至少选择一条记录");
		return ;
	}
	if(confirm("确定删除？删除后无法恢复。")){
		var ids = '';
		for(var i = 0;i<$obj.length;i++){
			if(i == $obj.length-1){
				ids += $($obj[i]).val();
			}else{
				ids += $($obj[i]).val()+",";
			}
		}
		var url = contextPath+"/index/deleteMoney.json";
    	$.post(url, {"ids":ids},
			function(ms) {
	 			if(ms.msg != null){
	 				if(ms.msg == "1"){
	 					infopad.msg("删除成功!");
	 					setTimeout(function(){
	 						location.reload();
						},1200);
	 				}else if(ms.msg == "2"){
	 					infopad.err("不是自己填写的，不可删除!");
	 				}else if(ms.msg == "3"){
	 					infopad.err("已审核通过，不可删除!");
	 				}else{
	 					infopad.err("抱歉，系统忙");
	 				}

	 			}else{
	 				infopad.err("抱歉，系统忙");
	 			}
    	});
    };
}

function getXiaZai(){
	var center = $("#center").val();
	var state = $("#name1").val();
	var stu_name = $("#stu_name").val();
	var nickname1 = $("#nickname1").val();
	var startTime = $("#startTime").val();
	var endTime = $("#endTime").val();
	if(startTime==""){
		alert("开始时间不能为空");
		return;
	}
	$.post('${contextPath}/index/fapiaoListXz.json',{
		center:center,
		state:state,
		stu_name:stu_name,
		nickname1:nickname1,
		startTime:startTime,
		endTime:endTime
	},function(data){
		if(data){
			if(data.name!=null){
				window.location.href = "http://www.yueqiao.org/mydata/uploadtea/xls/"+data.name;
			}
		}
	});
}


function submit(){
	window.location.href="${contextPath}/index/fapiaoList.htm?center="+$("#center").val()+"&stu_name="+$("#stu_name").val()+"&state="+$("#state").val()+"&nickname1="+$("#nickname1").val()+"&startTime="+$("#startTime").val()+"&endTime="+$("#endTime").val();
}


function uploadWeekToExcel(){
    location.href = "${contextPath}/index/uploadWeekToExcel.htm";
}

</script>
</head>

<body>
<input type="hidden" id="traId" value="">
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">客户接待查询</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">学员缴费列表</div>
		<table class="simple_table" rel="nohover" style="min-width: 750px;">
			<tr>
			
				<td>
				<#if webutil.getCookieUser().username=="system">
				<label for="phone">中心地址：</label> 
				<select id="center">
					<option value="">全部</option>
					<#if offList??>
					<#list offList as list>
						<option value="${list.keyname}">${list.name}</option>
					</#list>
					</#if>
				<select>
				 </#if>
				
				<label for="phone">审核状态：</label> 
				<select id="state">
					<option value="">全部</option>
					<option value="0">未审核</option>
					<option value="1">未通过</option>
					<option value="2">已审核</option>
				</select>
				
				<label for="phone">学生姓名：</label> 
				<input type="text" value="" id="stu_name" />
				
				<label for="phone">老师姓名：</label> 
				<input type="text" value="" id="nickname1" />
				
				<br/>
				<label for="phone">开始时间：</label>
				<input type="text" id="startTime" rel="DATE::Y-m-d" value="${startTime}" size="15" maxlength="15" readonly="readonly" class="DatePicker_Icon">
				<label for="phone">结束时间：</label>
				<input type="text" id="endTime" rel="DATE::Y-m-d" value="${endTime}" size="15" maxlength="15" readonly="readonly" class="DatePicker_Icon">
               	</td>
             
              	<td rowspan="4">
              	<input type="button" value=" 查 询 " onclick="submit()" />
                <td rowspan="2">
			</tr>
		</table>
		<table>
			<tr class="fields">
				<th width="3%"></th>
				<th width="70">学员姓名</th>
				<th width="70">联系电话</th>
				<th width="100">交款中心</th>
				<th width="70">接待老师</th>
				<th width="70">总金额</th>
				<th width="70">发票抬头</th>
				<th width="70">是否同意开具其他地区的税务发票</th>
				<th width="70">是否之前已开具过</th>
				<th width="70">是否紧急</th>
				<th width="70">紧急原因</th>
				<th width="100">交款时间</th>
				<th width="50">状态</th>
				<th width="50">操作</th>
			</tr>
			
			<#if list??>
				<#list list as list>
				<tbody id="datas">
					<tr class="even_row">
						<td align="center"><input name="" type="checkbox" value="${list.id}"></td>
						<td align="center"><#if list.stu_id?? && list.stu_id!=0>${list.stu_name}<#else>${list.student}</#if></td>
						<td align="center">
						<#if list.phlist??>
							<#list list.phlist as phlist>
							<a title="<#if phlist.phone!="">${phlist.phone}</#if> <#if list.qq!="">QQ：${list.qq}</#if> <#if list.weixin!="">微信：${list.weixin}</#if> <#if list.email!="">邮箱：${list.email}</#if> " id="${list.id}">
							<#assign phone1 = "${phlist.phone}">
							<#if phlist.name=="爸爸" || phlist.name=="妈妈">
								<em class="caption"></em>${phlist.phone}</br>
								<em class="caption"></em>${phlist.name}</br>
							<#elseif phlist.guanxi!="">
								<em class="caption"></em>${phlist.phone}</br>
								<em class="caption"></em>${phlist.guanxi}</br>
							<#else>
								<em class="caption"></em>${phlist.phone}</br>
								<em class="caption"></em>${phlist.name}</br>
							</#if>
							</a>
     						</#list>
     						<#else>
						<a title="<#if list.phone!="" && list.phone?contains('[]')==false>电话：${list.phone}</#if> <#if list.qq!="">QQ：${list.qq}</#if> <#if list.weixin!="">微信：${list.weixin}</#if> <#if list.email!="">邮箱：${list.email}</#if> " id="${list.id}">
     						<#if list.phone!="" && list.phone?contains('[]')==false>
     						<em class="caption"></em>${list.phone}
     						<#elseif list.qq!="">
     						<em class="caption">QQ:</em>${list.qq}
     						<#elseif list.email!="">
     						<em class="caption">email:</em>${list.email}
     						</#if>
     						</a>
     					</#if>
						</td>
						<td align="center">${list.center}</td>
						
						<td align="center">${list.nickname1}<br/>${list.nickname2}<br/>${list.record_teacher}</td>
						<td align="center">
							${list.fp_moneys}
						</td>
						<td align="center">
							${list.fp_tt}
						</td>
						<td align="center">
							<#if list.is_otkj==0>
								否
							<#elseif list.is_otkj==1>
								是
							</#if>
						</td>
						<td align="center">
							<#if list.is_zqkj==0>
								否
							<#elseif list.is_zqkj==1>
								是
							</#if>
						</td>
						<td align="center">
							<#if list.is_jj==0>
								否
							<#elseif list.is_jj==1>
								是
							</#if>
						</td>
						<td align="center">
							${list.jj_msg}
						</td>
						
						<td align="center"><#if list.moneyDate??>${list.moneyDate?date}</#if></td>
						<td align="center"><#if list.fp_state=="0">未审核<#elseif list.fp_state=="1">未通过<#elseif list.fp_state=="2">已通过</#if></td>
						<td align="center">
								<a href="${contextPath}/index/moenysDetail.htm?id=${list.id}&fp=1">查看</a>
						</td>
					</tr>
				</#list>
			</#if>
		</table>
	</div>
	
	<div id="pager">
	<ul id="pagination" style="padding-left: 14px">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				<#if currpage==1 >
					<li class="previous-off">首页</li>
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/fapiaoList.htm?currPage=1&startTime=${startTime}&endTime=${endTime}">首页</a></li>
					<li class="previous"><a href="${contextPath}/index/fapiaoList.htm?currPage=${currpage-1}&startTime=${startTime}&endTime=${endTime}">上一页</a></li>
					</#if>
					<input type="hidden" id="total" value="${page.pagetotal}" />	
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/fapiaoList.htm?currPage=${index_up}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/fapiaoList.htm?currPage=${index_up}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/fapiaoList.htm?currPage=${pagetotal}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a></li>
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/fapiaoList.htm?currPage=1&startTime=${startTime}&endTime=${endTime}">1</a></li>
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/fapiaoList.htm?currPage=${index_up}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/fapiaoList.htm?currPage=${pagetotal}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a></li>
			<#else>
				<li><a href="${contextPath}/index/fapiaoList.htm?currPage=1&startTime=${startTime}&endTime=${endTime}">1</a></li>
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/fapiaoList.htm?currPage=${index_up}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>
	           	</#if>
				</#list>  
			</#if>
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		 	<li class="previous-off">尾页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/fapiaoList.htm?currPage=${currpage+1}&startTime=${startTime}&endTime=${endTime}">下一页</a></li>
			<li class="previous"><a href="${contextPath}/index/fapiaoList.htm?currPage=${page.pagetotal}&startTime=${startTime}&endTime=${endTime}">尾页</a></li>
		</#if>
		<li class="previous"></li>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	
	<div class="emptyline"></div>
</body>
</html>